class Question < ActiveRecord::Base
  belongs_to :survey
  belongs_to :part
  #belongs_to :dimen
  has_and_belongs_to_many :dimens
  belongs_to :trend_scale
  has_many :choices, :dependent => :destroy
  
  #belongs_to :part, :class_name => "Question", :foreign_key => "part_id"
  #has_many :questions, :class_name => "Question", :foreign_key => "part_id"

  acts_as_list :scope => :survey
  # 属于某一个量表的素有 question 序号不能重复 ！
  #validates_uniqueness_of :number, :on=>:save ,:scope=> "survey_id" , :message =>"题目序号不能重复！"
  
  #validates_presence_of :title , :message => "问题标题不可为空"
  #validates_presence_of :description ,:message => "问题描述不能为空"
end
